package com.zhq.service;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zhq.Interface.dao.IUserDao;
import com.zhq.Interface.service.IUserService;


public class UserServiceTest {
	private IUserService userService;
	private static ClassPathXmlApplicationContext ctx;
    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
    	ctx = new ClassPathXmlApplicationContext(new String[]{"applicationContext.xml"});
    }
    
    
    @Before
    public void setUp() throws Exception {
    	userService =(IUserService)ctx.getBean("userService");
    }
	@Test
	public void testIsExist() {
		System.out.println(userService.isExist(2));
	}
	
	@Test
	public void testFetchUsers() {
		System.out.println(userService.fetchUsers());
	}
}
